# Uncomment the lines below you want to change by removing the # in the beginning
# Verify script has credentials

fastlane_directory = File.expand_path File.dirname(__FILE__)
# __FILE__ can return different results when this file is required or used directly
# This allows it to work in all cases
if File.basename(fastlane_directory) != "fastlane"
  fastlane_directory = File.join fastlane_directory, "fastlane"
end

# A list of devices you want to take the screenshots from
devices([
  "iPhone Xs Max",
  "iPhone 8 Plus",
  "iPad Pro (12.9-inch) (2nd generation)",
  "iPad Pro (12.9-inch) (3rd generation)",
])

# Where should the resulting screenshots be stored?
output_directory File.join fastlane_directory, "screenshots"

scheme "WordPressScreenshotGeneration"

# clear_previous_screenshots true # remove the '#'' to clear all previously generated screenshots before creating new ones

# Where is your project (or workspace)? Provide the full path here
workspace File.join fastlane_directory, "../../WordPress.xcworkspace"

# Since Fastlane searches recursively from the current directory for the helper (Scripts/ or fastlane/),
# this check will always fail for us
skip_helper_version_check true

reinstall_app true
erase_simulator true
localize_simulator true
concurrent_simulators false
clear_previous_screenshots true

# By default, the latest version should be used automatically. If you want to change it, do it here
# ios_version '8.1'

# Custom Callbacks

# setup_for_device_change do |device| 
#   puts "Preparing device: #{device}"
# end

# setup_for_language_change do |lang, device|
#   puts "Running #{lang} on #{device}"
#   system("./popuplateDatabase.sh")
# end

# teardown_language do |lang, device|
#   puts "Finished with #{lang} on #{device}"
# end

# teardown_device do |device|
#   puts "Cleaning device #{device}"
#   system("./cleanup.sh")
# end
